using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Profile;
using webapp4U;

namespace webapp4U.UI.Admin
{
    public partial class ManageUsers : System.Web.UI.Page //BasePage
   {
       protected void Page_Load(object sender, EventArgs e)
       {
           if (!IsPostBack)
           {
               string[] roles = Roles.GetAllRoles();
               RolesDropDownList.DataSource = roles;
               RolesDropDownList.DataBind();
           }

           NewUser.Text = ResourceManager.GetString("Membership_Add");
           NewUser.NavigateUrl = Globals.ApplicationPath + "WebMaster/Membership/CreateUser.aspx";
       }


       protected void btDelete_Click(object sender, EventArgs e)
       {
           foreach (GridViewRow row in GridViewItem.Rows)
           {
               bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
               if (isChecked)
               {
                   string UserName = (((CheckBox)row.FindControl("chkSelect")).ToolTip.Trim());
                   //ProfileManager.DeleteProfile(UserName);
                   Membership.DeleteUser(UserName);
               }
           }
           this.DataBind();
       }

       protected void btSearch_Click(object sender, EventArgs e)
       {
           GridViewItem.DataSourceID = "SearchDataSource";
       }
   }
}